#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
	freopen("fruit.in","r",stdin);
	freopen("fruit.out","w",stdout);
	int n,now=0,flag,a[200002]={0},f[200002]={0};
	cin>>n;
	flag=n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
    }
	while(flag!=0){
		int k=0;
	    now++;
	    k=now;
	    while(f[now]!=0) now++;
		now=(now-1)%n+1;
		if(a[k]!=a[now]&&f[now]==0&&f[k]==0){
			cout<<now<<' ';
			flag--;
			f[now]==1;
		}
		if(now==n) cout<<endl;
	}
	fclose(stdin);
	fclose(stdout);
	return 0;
 } 
